package com.test.action;

import java.util.List;

import com.test.entity.News;
import com.test.service.NewsService;
import com.test.util.PageUtil;

public class NewsDetailAction extends BaseAction {
	private NewsService newsService;
	private int curpage1;

	public String NewsDetail() throws Exception {
		int countInteger = Integer.parseInt(newsService.queryRecordAmount()
				.toString());
		PageUtil pageUtil = new PageUtil(countInteger, 2);
		pageUtil.count(curpage1);
		List<News> kList = newsService.queryNewsdetail(pageUtil.getPageSize(),
				curpage1);
		this.getRequest().put("pageUtil", pageUtil);
		this.getRequest().put("list", kList);
		return "NewsDetail";
	}

	public NewsService getNewsService() {
		return newsService;
	}

	public void setNewsService(NewsService newsService) {
		this.newsService = newsService;
	}

	public int getCurpage1() {
		return curpage1;
	}

	public void setCurpage1(int curpage1) {
		this.curpage1 = curpage1;
	}

}
